﻿<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true"
    CodeFile="convocacao.aspx.cs" Inherits="_convocacao" %>

<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dxpc" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.1" Namespace="DevExpress.Web.ASPxPopupControl"
    TagPrefix="dxpc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .tabela
        {
            font: 18px tahoma, arial;
        }
        .tabela span
        {
            font: normal normal normal 10pt normal normal tahora, arial;
        }
        .dados
        {
            font-size: 11pt;
        }
        .descricao
        {
            width: 345px;
        }
        select
        {
            font: normal normal normal 9pt normal normal tahoma, arial;
            padding: 5px;
        }
        .nome
        {
            text-align: right;
            font: bold 30px Tahoma, Arial;
            color: #006C91;
        }
        
        img
        {
            border: none;
        }
        
        input[type=text], input[type=password]
        {
            padding: 5px;
        }
        .style1
        {
            width: 247px;
        }
        .style2
        {
            font-size: 10pt;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">        muda(alterar, '#0C5C7E');</script>
    <table style="width: 494px; margin-top: 10px;" cellpadding="0" cellspacing="4" class="tabela">
        <tr>
            <td colspan="2" class="nome">
                Gestão dos Convocados
            </td>
        </tr>
        <tr>
            <td class="dados" colspan="2">
                &nbsp;
            </td>
        </tr>
    </table>
    <table style="width: 494px; margin-top: 10px;" cellpadding="0" cellspacing="4" class="tabela">
        <tr>
            <td class="descricao">
                <asp:Label ID="lblEmpresa" runat="server" Text="Empresa:" CssClass="descricao"></asp:Label>
            </td>
            <td align="left" class="style1">
                <asp:SqlDataSource ID="dsEmpresas" runat="server" ConnectionString="<%$ ConnectionStrings:conexao_intranet %>"
                    ProviderName="<%$ ConnectionStrings:conexao_intranet.ProviderName %>" SelectCommand="select distinct e.Id_Empresa, e.NomeFantasia from BKCamaraConsultas cc INNER JOIN BKCamaraEmpresas e ON (e.CNPJ = cc.CNPJ) group by e.Id_Empresa, e.CNPJ, e.NomeFantasia order by e.NomeFantasia">
                </asp:SqlDataSource>
                <asp:DropDownList ID="cboEmpresa" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                    Height="26px" Width="404px" OnSelectedIndexChanged="cboEmpresa_SelectedIndexChanged"
                    DataSourceID="dsEmpresas" DataTextField="NomeFantasia" DataValueField="Id_Empresa">
                    <asp:ListItem></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <asp:Panel ID="pnlTurmas" runat="server" Visible="False">
            <tr>
                <td class="descricao">
                    <asp:Label ID="lblContato" runat="server" Text="Nome:" CssClass="descricao"></asp:Label>
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtNomeContato" runat="server" MaxLength="100" Width="390px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="descricao">
                    <asp:Label ID="lblEmailContato" runat="server" Text="Email:" CssClass="descricao"></asp:Label>
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtEmailContato" runat="server" MaxLength="100" Width="390px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="descricao">
                    <asp:Label ID="lblFoneContato" runat="server" Text="Telefone:" CssClass="descricao"></asp:Label>
                </td>
                <td align="left" class="style1">
                    <asp:TextBox ID="txtFoneContato" runat="server" MaxLength="100" Width="390px"></asp:TextBox>
                </td>
            </tr>
        </asp:Panel>
    </table>
    <%--DataKeyNames="CodTurma"--%>
    <table style="width: 494px; margin-top: 10px;" cellpadding="0" cellspacing="4" class="tabela">
        <tr>
            <td align="left" style="font-size: 9pt">
                <asp:GridView ID="grdConvocados" runat="server" AutoGenerateColumns="False" DataSourceID="dsConvococao"
                    EnableModelValidation="True" CellPadding="4" ForeColor="#333333" GridLines="None"
                    Width="510px" Visible="False" Style="font-size: 9pt" DataKeyNames="consultan"
                    OnSelectedIndexChanged="grdConvocados_SelectedIndexChanged" OnRowDataBound="grdConvocados_RowDataBound">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="nomealuno" HeaderText="Nome">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="280px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="email" HeaderText="Email">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="telefone" HeaderText="Fone">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="150px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Convocado">
                            <ItemTemplate>
                                <asp:Label ID="lblConvocado" runat="server" Text='<%# Eval("convocado") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkConvocar" runat="server" CausesValidation="False" CommandName="Select"
                                    OnClick="lnkConvocar_Click" Text="Convocar"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="lnkDesc" runat="server" CausesValidation="False" CommandName="Select"
                                    OnClick="lnkDesc_Click" Text="Desconvocar"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                </asp:GridView>
                <asp:SqlDataSource ID="dsConvococao" runat="server" ConnectionString="<%$ ConnectionStrings:conexao_intranet %>"
                    SelectCommand="select distinct cc.consultan, ci.nomealuno, ci.email, ci.telefone, ci.telefone2, cc.Convocado from BKCamaraConsultas cc INNER JOIN bkcamarainscritos ci ON (cc.cpf = ci.cpf) INNER JOIN BKCamaraEmpresas ce ON (cc.cnpj = ce.cnpj) where ce.id_empresa = @Id_Empresa and cc.Convocado = 1 order by ci.nomeAluno">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="cboEmpresa" Name="Id_Empresa" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
    <table style="width: 494px; margin-top: 10px;" cellpadding="0" cellspacing="4" class="tabela">
        <tr>
            <td>
                <asp:Panel ID="pnlAlterarConv" runat="server" Visible="False">
                    <table>
                        <tr>
                            <td colspan="2" style="height: 10px;">
                            </td>
                        </tr>
                        <tr>
                            <td align="left" colspan="2">
                                <asp:Label ID="Label2" runat="server" Text="ID:" CssClass="style2"></asp:Label>&nbsp;
                                <asp:Label ID="lblCodConvocacao" runat="server" Text="" CssClass="style2"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label5" runat="server" Text="Compareceu:" CssClass="style7" Style="font-size: 10pt"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:RadioButton ID="rdbCompSim" GroupName="Comparecimento" runat="server" Text="Sim"
                                    CssClass="style2" />
                                <asp:RadioButton ID="rdbCompNao" GroupName="Comparecimento" runat="server" Text="Não"
                                    CssClass="style2" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="text-align: left">
                                <asp:Label ID="lblConvocado" runat="server" Text="Convocado:" CssClass="style7" Style="font-size: 10pt"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:RadioButton ID="rdbConvSim" GroupName="Convocados" runat="server" Text="Sim"
                                    CssClass="style2" />
                                <asp:RadioButton ID="rdbConvNao" GroupName="Convocados" runat="server" Text="Não"
                                    CssClass="style2" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="text-align: left">
                                <asp:Label ID="lblMotivo" runat="server" Text="Motivo Conv:" CssClass="style7"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtMotivo" runat="server" Rows="4" TextMode="MultiLine" CssClass="dados"
                                    Width="380px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="descricao">
                                <asp:Label ID="lblDtConvocacao" runat="server" Text="Data Conv.:" CssClass="style7"></asp:Label>
                            </td>
                            <td>
                                <dxe:ASPxDateEdit ID="DtConvocacao" runat="server" CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css"
                                    CssPostfix="Office2003_Blue" ImageFolder="~/App_Themes/Office2003 Blue/{0}/"
                                    Width="100px">
                                    <CalendarProperties ClearButtonText="Limpar" TodayButtonText="Hoje" ShowWeekNumbers="False">
                                    </CalendarProperties>
                                </dxe:ASPxDateEdit>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="height: 4px;">
                            </td>
                        </tr>
                    </table>
                    <div style="text-align: right">
                        <asp:ImageButton ID="btnAlterar" runat="server" ImageUrl="../figuras/bAlterar.gif"
                            OnClick="btnAlterar_Click" />
                        &nbsp;</div>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="pnlAlterarDesconv" runat="server" Visible="False">
                    <table>
                        <tr>
                            <td colspan="2" style="height: 10px;">
                            </td>
                        </tr>
                        <tr>
                            <td align="left" colspan="2">
                                <asp:Label ID="Label1" runat="server" Text="ID:" CssClass="style2"></asp:Label>&nbsp;
                                <asp:Label ID="lblCodDesconvocacao" runat="server" Text="" CssClass="style2"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label4" runat="server" Text="Compareceu:" CssClass="style7" Style="font-size: 10pt"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:RadioButton ID="rdbCompSimDesc" GroupName="Comparecimento" runat="server" Text="Sim"
                                    CssClass="style2" />
                                <asp:RadioButton ID="rdbCompNoDesc" GroupName="Comparecimento" runat="server" Text="Não"
                                    CssClass="style2" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="text-align: left">
                                <asp:Label ID="Label6" runat="server" Text="Convocado:" CssClass="style7" Style="font-size: 10pt"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:RadioButton ID="rdbConvSimDesconv" GroupName="Convocados" runat="server" Text="Sim"
                                    CssClass="style2" />
                                <asp:RadioButton ID="rdbConvNoDesconv" GroupName="Convocados" runat="server" Text="Não"
                                    CssClass="style2" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="text-align: left">
                                <asp:Label ID="lblMtvDesc" runat="server" Text="Motivo Desc:" CssClass="style7"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtMotivoDesc" runat="server" Rows="4" TextMode="MultiLine" CssClass="dados"
                                    Width="380px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="descricao">
                                <asp:Label ID="Label3" runat="server" Text="Dt. Consulta.:" CssClass="style7"></asp:Label>
                            </td>
                            <td>
                                <dxe:ASPxDateEdit ID="Dt_Consulta" runat="server" CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css"
                                    CssPostfix="Office2003_Blue" ImageFolder="~/App_Themes/Office2003 Blue/{0}/"
                                    Width="100px">
                                    <CalendarProperties ClearButtonText="Limpar" TodayButtonText="Hoje" ShowWeekNumbers="False">
                                    </CalendarProperties>
                                </dxe:ASPxDateEdit>
                            </td>
                        </tr>
                        <tr>
                            <td align="descricao">
                                <asp:Label ID="lblDtDesc" runat="server" Text="Dt. Desconv.:" CssClass="style7"></asp:Label>
                            </td>
                            <td>
                                <dxe:ASPxDateEdit ID="Dt_Desconv" runat="server" CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css"
                                    CssPostfix="Office2003_Blue" ImageFolder="~/App_Themes/Office2003 Blue/{0}/"
                                    Width="100px">
                                    <CalendarProperties ClearButtonText="Limpar" TodayButtonText="Hoje" ShowWeekNumbers="False">
                                    </CalendarProperties>
                                </dxe:ASPxDateEdit>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="height: 4px;">
                            </td>
                        </tr>
                    </table>
                    <div style="text-align: right">
                        <asp:ImageButton ID="btnAltDesc" runat="server" ImageUrl="../figuras/bAlterar.gif"
                            OnClick="btnAltDesc_Click" />
                        &nbsp;</div>
                </asp:Panel>
            </td>
        </tr>
    </table>
    <dxpc:ASPxPopupControl ID="ASPxPopupControl1" runat="server" HeaderText="INTRANET SENAC/PE - AVISO"
        Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
        <ContentCollection>
            <dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
                <table style="width: 500px;">
                    <tr>
                        <td>
                            <asp:Image ID="iStatus" runat="server" ImageUrl="~/figuras/icoOK.png" />
                        </td>
                        <td align="left">
                            <asp:Label ID="lMensagem" runat="server" EnableViewState="False" Text="Solicitação cadastrada com sucesso!"></asp:Label>
                        </td>
                    </tr>
                </table>
            </dxpc:PopupControlContentControl>
        </ContentCollection>
    </dxpc:ASPxPopupControl>
</asp:Content>
